<template>
    <div class="enterprise-information-index">
        <!-- <a-upload :beforeUpload="$event=>{return false}" 
                                        action="" 
                                        @change="enterpriseUpload" directory>
            <a-button> <a-icon type="upload" /> Upload Directory </a-button>
        </a-upload> -->
        <div class="palace-grid-breadcrumb" :style="{height:!height?'calc(100vh - 203px)' :'calc(100vh - 130px)'}">
            <div class="breadcrumb-box1">
                <a-breadcrumb separator=">" >
                    <a-breadcrumb-item :class="activeKey?'info-card-breadcrumb-text':''">
                        <a v-if="activeKey" @click="breadcrumbChange('采集信息')">采集信息</a>
                        <span v-else>采集信息</span>
                    </a-breadcrumb-item>
                    <a-breadcrumb-item >{{ activeKey }}</a-breadcrumb-item>
                    <!-- :class="activeKey?'info-card-breadcrumb-text':''" -->
                </a-breadcrumb>
            </div>
            
            <div class="palace-grid-box" v-if="!activeKey" :style="{height:!height?'calc(100vh - 248px)' :'calc(100vh - 180px)'}">
                <div class="grid-box-for" v-for="(item,index) in activeList" :key="index" @click="activeChange(item)">
                    <span>{{ item }}</span>
                </div>
            </div>
            <!-- <div class="enterprise-review-tabs">
                <a-tabs type="card" v-model:activeKey="activeKey">
                    <a-tab-pane key="企业信息" tab="企业信息"></a-tab-pane>
                    <a-tab-pane key="品种基本信息" tab="品种基本信息"></a-tab-pane>
                    <a-tab-pane key="企业关键人员信息" tab="企业关键人员信息"></a-tab-pane>
                    <a-tab-pane key="证件信息" tab="证件信息"></a-tab-pane>
                    <a-tab-pane key="质量管理体系文件" tab="质量管理体系文件"></a-tab-pane>
                    <a-tab-pane key="设备确认信息" tab="设备确认信息"></a-tab-pane>
                    <a-tab-pane key="工艺验证" tab="工艺验证"></a-tab-pane>
                    <a-tab-pane key="清洁验证" tab="清洁验证"></a-tab-pane>
                    <a-tab-pane key="变更控制" tab="变更控制"></a-tab-pane>
                    <a-tab-pane key="偏差处理" tab="偏差处理"></a-tab-pane>
                    <a-tab-pane key="供应商审计" tab="供应商审计"></a-tab-pane>
                    <a-tab-pane key="投诉与不良反应信息报告" tab="投诉与不良反应信息报告"></a-tab-pane>
                    <a-tab-pane key="抽检不合格信息文件" tab="抽检不合格信息文件"></a-tab-pane>
                    <a-tab-pane key="违法违规" tab="违法违规"></a-tab-pane>
                    <a-tab-pane key="审评信息" tab="审评信息"></a-tab-pane>
                    <a-tab-pane key="检验记录" tab="检验记录"></a-tab-pane>
                </a-tabs>
            </div> -->
        
        <!-- <a-collapse default-active-key="1" >
            <template #expandIcon="props">
                <a-icon type="double-right" :rotate="props.isActive ? 90 : 0" />
            </template>
            <a-collapse-panel key="1" header="企业信息" :style="customStyle"> -->
            <div v-if="activeKey  == '企业信息'" class="enterprise-information-content">
                <div style="background-color: #fff;margin: 20px;">
                    <a-form :form="form" layout="horizontal" class="enterprise-information-index-form">
                        <a-form-item label="企业名称">
                            <a-input
                            v-model:value="formState.fqymc"
                            placeholder="请输入企业名称"
                            v-decorator="[
                                'fqymc', { initialValue:formState.fqymc, rules: rules.fqymc}
                            ]"/>
                        </a-form-item>
                        <a-form-item label="所在地区">
                            <a-input v-model:value="formState.fszdq" placeholder="请输入所在地区"/>
                            <!-- <a-select
                                v-model:value="formState.fszdq"
                                placeholder="请选择所在地区"
                            >
                                <a-select-option :value="item.value" v-for="(item,index) in optionsArr">
                                    {{item.label}}
                                </a-select-option>
                            </a-select> -->
                        </a-form-item>
                        <a-form-item label="分类码">
                            <a-input v-model:value="formState.fflm" placeholder="请输入分类码"/>
                        </a-form-item>
                        <a-form-item label="统一社会信用代码">
                            <a-input
                            disabled
                            v-model:value="formState.ftyshxydm"
                            placeholder="请输入统一社会信用代码"
                            v-decorator="[
                                'ftyshxydm', { initialValue:formState.ftyshxydm, rules: rules.ftyshxydm}
                            ]"/>
                        </a-form-item>
                        <a-form-item label="企业许可证号">
                            <a-input v-model:value="formState.fqyxkzh" placeholder="请输入企业许可证号"/>
                        </a-form-item>
                        <a-form-item label="企业许可证有效期">
                            <a-date-picker v-model:value="formState.fqyxkzyxq" placeholder="请输入企业许可证有效期"/>
                        </a-form-item>
                        <a-form-item label="发证日期">
                            <a-date-picker v-model:value="formState.ffzrq" placeholder="请输入发证日期"/>
                        </a-form-item>
                        <a-form-item label="企业法定代表人/负责人">
                            <a-input v-model:value="formState.fqyfddbrfzr" placeholder="请输入企业法定代表人/负责人"/>
                        </a-form-item>
                        <a-form-item label="企业联系人">
                            <a-input v-model:value="formState.fqylxr" placeholder="请输入企业联系人"/>
                        </a-form-item>
                        <a-form-item label="企业联系人电话">
                            <a-input v-model:value="formState.fqylxrdh" placeholder="请输入企业联系人电话"/>
                        </a-form-item>
                        <a-form-item label="企业联系人邮箱">
                            <a-input v-model:value="formState.fqylxryx" placeholder="请输入企业联系人邮箱"/>
                        </a-form-item>
                        <a-form-item label="传真">
                            <a-input v-model:value="formState.fcz" placeholder="请输入传真"/>
                        </a-form-item>
                        <a-form-item label="注册资本">
                            <a-input v-model:value="formState.fzczb" placeholder="请输入注册资本"/>
                        </a-form-item>
                        <a-form-item label="行政机构">
                            <a-input v-model:value="formState.fxzjg" placeholder="请输入行政机构"/>
                        </a-form-item>
                        <a-form-item label="企业类型">
                            <a-select
                                ref="select"
                                placeholder="请选择企业类型"
                                v-model:value="formState.fqylx"
                                v-decorator="[
                                    'fqylx', { initialValue:formState.fqylx, rules: rules.fqylx}
                                ]"
                                >
                                <a-select-option value="药品">药品</a-select-option>
                                <a-select-option value="化妆品">化妆品</a-select-option>
                                <a-select-option value="医疗器械">医疗器械</a-select-option>
                            </a-select>
                        </a-form-item>
                        <a-form-item label="企业住所/注册地址" class="flex-1-box">
                            <a-input v-model:value="formState.fqyzszcdz" placeholder="请输入企业住所/注册地址"/>
                        </a-form-item>
                        <a-form-item label="生产地址" class="flex-1-box">
                            <a-input v-model:value="formState.fxxdz" placeholder="请输入生产地址"/>
                        </a-form-item>
                        <a-form-item label="生产范围" class="flex-1-box">
                            <a-textarea
                                placeholder="请输入生产范围"
                                v-model:value="formState.fscfw"
                                :autosize="{ minRows: 3, maxRows: 10000 }"
                            ></a-textarea>
                        </a-form-item>
                        <div style="display: flex;justify-content: center;margin: 20px 0; width: 100%;" v-if="!isDisabled">
                            <a-button class="blue-btn" type="primary" @click="saveClick()">保存</a-button>
                        </div>
                    </a-form>
                </div>
            </div>
            <!-- </a-collapse-panel> -->
            <!-- <a-collapse-panel key="4" header="品种基本信息" :style="customStyle"> -->
            <div v-if="activeKey  == '品种基本信息'" class="enterprise-information-content">
                <commpVxeTable
                    :key="refreshTable"
                    ref="headmanVxeTable"
                    :config="{
                        api:assessCheckApi.spcyQyInfoQueryPzjbxxPageList,
                        rowId: 'id',
                        height:400,
                        autoHidden:true,
                        paramet:{
                            fqyid:formState.id
                        }
                    }" 
                    :columns="breedColumnsVxe" 
                    :formItem="[]"
                    :isCanWrap="true"
                    :adaptiveHeight="true"
                    @updatedChange="updatedChange"
                > 
                    <template v-slot:externalOperations="{data}" v-if="!isDisabled">
                        <vxe-form-item>
                            <template>
                                <a-button class="blue-btn" type="primary" @click="addClick(2)">新增</a-button>
                            </template>
                        </vxe-form-item>
                    </template>
                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏" >
                        <a-form layout="inline" class="search-form">
                            <a-form-item v-if="!isDisabled">
                                <a-button class="blue-btn" type="primary" @click="productionRecordsClick(row,2)" >生产记录</a-button>
                            </a-form-item>
                            <a-form-item v-if="!isDisabled">
                                <a-button class="blue-btn" type="primary" @click="editClick(row,2)" >编辑</a-button>
                            </a-form-item>
                            <a-form-item v-else>
                                <a-button class="blue-btn" type="primary" @click="editClick(row,2,'查看')" >查看</a-button>
                            </a-form-item>
                            <br/>
                            <a-form-item v-if="!isDisabled">
                                <a-button class="blue-btn" type="primary" @click="keyIndicatorsClick(row,2)" >关键指标</a-button>
                            </a-form-item>
                            <a-form-item v-if="!isDisabled">
                                <a-button class="red-btn" type="primary" @click="deleteClick(row,2)" >删除</a-button>
                            </a-form-item>
                        </a-form> 
                    </template>
                </commpVxeTable>
            </div>
            <!-- </a-collapse-panel>
            <a-collapse-panel key="2" header="企业关键人员信息" :style="customStyle" class="collapse-panel-head-l255"> -->
            <div v-if="activeKey  == '企业关键人员信息'" class="enterprise-information-content">
                <div class="enterprise-review-tabs">
                    <a-tabs type="card" v-model:activeKey="KeyPersonActiveKey" @change="KeyPersonActiveChange">
                        <a-tab-pane key="人员信息" tab="人员信息"></a-tab-pane>
                        <a-tab-pane key="岗位变更记录" tab="岗位变更记录"></a-tab-pane>
                    </a-tabs>
                </div>
                <commpVxeTable
                    v-if="KeyPersonActiveKey == '人员信息'"
                    :key="refreshTable"
                    ref="headmanVxeTable"
                    :config="{
                        api:assessCheckApi.spcyQyInfoQqueryQygjryxxPageList,
                        rowId: 'id',
                        autoHidden:true,
                        paramet:{
                            fqyid:formState.id
                        }
                    }" 
                    :columns="enterpriseColumnsVxe" 
                    :formItem="[]"
                    :isCanWrap="true"
                    :occupancyHeight="140"
                    @updatedChange="updatedChange"
                > 
                    <template v-slot:externalOperations="{data}" v-if="!isDisabled">
                        <vxe-form-item>
                            <template>
                                <a-button class="blue-btn" type="primary" @click="addClick(0)">新增</a-button>
                            </template>
                        </vxe-form-item>
                    </template>
                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                        <a-form layout="inline" class="search-form" >
                            <a-form-item v-if="!isDisabled">
                                <a-button class="blue-btn" type="primary" @click="editClick(row,0)" >编辑</a-button>
                            </a-form-item>
                            <a-form-item v-else>
                                <a-button class="blue-btn" type="primary" @click="editClick(row,0,'查看')" >查看</a-button>
                            </a-form-item>
                            <a-form-item v-if="!isDisabled">
                                <a-button class="blue-btn" type="primary" @click="JobChangeClick(row,0)" >岗位变更</a-button>
                            </a-form-item>
                            <a-form-item v-if="!isDisabled">
                                <a-button class="red-btn" type="primary" @click="deleteClick(row,0)" >删除</a-button>
                            </a-form-item>
                        </a-form> 
                    </template>
                </commpVxeTable>
                <commpVxeTable
                    v-if="KeyPersonActiveKey == '岗位变更记录'"
                    :key="refreshTable"
                    ref="headmanVxeTable"
                    :config="{
                        api:assessCheckApi.spcyQyInfoqueryQyRyBgjlPageList,
                        rowId: 'id',
                        paramet:{
                            fqyid:formState.id
                        }
                    }" 
                    :columns="gwbgpriseColumnsVxe" 
                    :formItem="[]"
                    :isCanWrap="true"
                    :occupancyHeight="140"
                    @updatedChange="updatedChange"
                > 
                </commpVxeTable>
            </div>
            <div v-if="activeKey  == '证件信息'" class="enterprise-information-content">
                <commpVxeTable
                    :key="refreshTable"
                    ref="headmanVxeTable"
                    :config="{
                        api:assessCheckApi.spcyQyInfoqueryQyZjxxPageList,
                        rowId: 'id',
                        paramet:{
                            fqyid:formState.id
                        }
                    }" 
                    :isCanWrap="true"
                    :columns="documentInformationColumnsVxe" 
                    :formItem="documentInformationFormItem"
                    @updatedChange="updatedChange"
                    :occupancyHeight="90"
                > 
                    <template v-slot:externalOperations="{data}" v-if="!isDisabled">
                        <vxe-form-item>
                            <template>
                                <a-button class="blue-btn" type="primary" @click="addClick(9)">新增</a-button>
                            </template>
                        </vxe-form-item>
                    </template>
                    <template v-slot:sfgq_name="{row}">
                        <span v-if="row.sfgq == '长期有效'" style="color: #91cc75;">长期有效</span>
                        <span v-if="row.sfgq == '未过期'" style="color: #5470c6;">未过期</span>
                        <span v-if="row.sfgq == '即将过期'" style="color: #fac858;">即将过期</span>
                        <span v-if="row.sfgq == '已过期'" style="color: #ee6666;">已过期</span>
                    </template>
                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                        <a-form layout="inline" class="search-form" >
                            <a-form-item v-if="!isDisabled">
                                <a-button class="blue-btn" type="primary" @click="editClick(row,9)" >编辑</a-button>
                            </a-form-item>
                            <a-form-item v-else>
                                <a-button class="blue-btn" type="primary" @click="editClick(row,9,'查看')" >查看</a-button>
                            </a-form-item>
                            <a-form-item v-if="!isDisabled">
                                <a-button class="red-btn" type="primary" @click="deleteClick(row,9)" >删除</a-button>
                            </a-form-item>
                        </a-form> 
                    </template>
                </commpVxeTable>
            </div>
            <!-- </a-collapse-panel>
            <a-collapse-panel key="11" header="质量管理体系文件" :style="customStyle" class="collapse-panel-head-l380"> -->
            <div v-if="activeKey  == '质量管理体系文件'" class="enterprise-information-content">
                <a-upload 
                :disabled="uploadLoading"
                style="display: inline-block;" 
                :beforeUpload="$event=>{return false}" 
                action="" 
                @change="WjljByTypeUpload($event,formState.id,'质量管理体系文件')">
                    <a-button :loading="uploadLoading" class="blue-btn" type="primary">上传</a-button>
                </a-upload>
                <commpVxeTable
                    :key="refreshTable"
                    ref="headmanVxeTable"
                    :config="{
                        api:assessCheckApi.queryWjljByType,
                        rowId: 'id',
                        height:400,
                        autoHidden:true,
                        paramet:{
                            fqyid:formState.id,
                            fwjlx1:'质量管理体系文件'
                        }
                    }" 
                    :columns="WjljByTypeColumnsVxe" 
                    :formItem="[]"
                    :adaptiveHeight="true"
                    @updatedChange="updatedChange"
                > 
                
                    <template v-slot:name_fwjxsmc="{row}" data-desc="自定操作栏">
                        <span>{{ row.fwjxsmc }}{{ row.fwjlx }}</span>
                    </template>
                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                        <a-form layout="inline" class="search-form" >
                            <a-form-item>
                                <a-button class="red-btn" type="primary" @click="deleteWjClick(row)" >删除</a-button>
                            </a-form-item>
                            <a-form-item>
                                <a-button class="blue-btn" type="primary" @click="downloadWjClick(row)" >下载</a-button>
                            </a-form-item>
                            <a-form-item>
                                <a-button class="blue-btn" type="primary" @click="lookOverWjClick(row)" v-if="row.fwjlx == '.pdf'">查看</a-button>
                            </a-form-item>
                            
                        </a-form> 
                    </template>
                </commpVxeTable>
            </div>
            <!-- </a-collapse-panel>
            <a-collapse-panel key="5" header="设备确认信息" :style="customStyle"> -->
            <div v-if="activeKey  == '设备确认信息'" class="enterprise-information-content">
                <commpVxeTable
                    :key="refreshTable"
                    ref="headmanVxeTable"
                    :config="{
                        api:assessCheckApi.spcyQyInfoQuerySbqrxxPageList,
                        rowId: 'id',
                        height:400,
                        autoHidden:true,
                        paramet:{
                            fqyid:formState.id
                        }
                    }" 
                    :columns="deviceColumnsVxe" 
                    :formItem="[]"
                    :adaptiveHeight="true"
                    @updatedChange="updatedChange"
                > 
                    <template v-slot:externalOperations="{data}" v-if="!isDisabled">
                        <vxe-form-item>
                            <template>
                                <a-button class="blue-btn" type="primary" @click="addClick(3)">新增</a-button>
                            </template>
                        </vxe-form-item>
                    </template>
                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                        <a-form layout="inline" class="search-form" >
                            <a-form-item v-if="!isDisabled">
                                <a-button class="blue-btn" type="primary" @click="editClick(row,3)" >编辑</a-button>
                            </a-form-item>
                            <a-form-item v-else>
                                <a-button class="blue-btn" type="primary" @click="editClick(row,3,'查看')" >查看</a-button>
                            </a-form-item>
                            <a-form-item v-if="!isDisabled">
                                <a-button class="red-btn" type="primary" @click="deleteClick(row,3)" >删除</a-button>
                            </a-form-item>
                        </a-form> 
                    </template>
                </commpVxeTable>
            </div>
            <!-- </a-collapse-panel>
            <a-collapse-panel key="9" header="工艺验证" :style="customStyle"> -->
            <div v-if="activeKey  == '工艺验证'" class="enterprise-information-content">
                <commpVxeTable
                    :key="refreshTable"
                    ref="headmanVxeTable"
                    :config="{
                        api:assessCheckApi.spcyQyInfoQueryQyGyyzPageList,
                        rowId: 'id',
                        height:400,
                        autoHidden:true,
                        paramet:{
                            fqyid:formState.id
                        }
                    }" 
                    :columns="technologyColumnsVxe" 
                    :formItem="[]"
                    :adaptiveHeight="true"
                    @updatedChange="updatedChange"
                > 
                    <template v-slot:externalOperations="{data}" v-if="!isDisabled">
                        <vxe-form-item>
                            <template>
                                <a-button class="blue-btn" type="primary" @click="addClick(7)">新增</a-button>
                            </template>
                        </vxe-form-item>
                    </template>
                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                        <a-form layout="inline" class="search-form" >
                            <a-form-item v-if="!isDisabled">
                                <a-button class="blue-btn" type="primary" @click="editClick(row,7)" >编辑</a-button>
                            </a-form-item>
                            <a-form-item v-else>
                                <a-button class="blue-btn" type="primary" @click="editClick(row,7,'查看')" >查看</a-button>
                            </a-form-item>
                            <a-form-item v-if="!isDisabled">
                                <a-button class="red-btn" type="primary" @click="deleteClick(row,7)" >删除</a-button>
                            </a-form-item>
                        </a-form> 
                    </template>
                </commpVxeTable>
            </div>
            <!-- </a-collapse-panel>
            <a-collapse-panel key="8" header="清洁验证" :style="customStyle"> -->
            <div v-if="activeKey  == '清洁验证'" class="enterprise-information-content">
                <commpVxeTable
                    :key="refreshTable"
                    ref="headmanVxeTable"
                    :config="{
                        api:assessCheckApi.spcyQyInfoQueryQjyzPageList,
                        rowId: 'id',
                        height:400,
                        autoHidden:true,
                        paramet:{
                            fqyid:formState.id
                        }
                    }" 
                    :columns="cleanColumnsVxe" 
                    :formItem="[]"
                    :adaptiveHeight="true"
                    @updatedChange="updatedChange"
                > 
                    <template v-slot:externalOperations="{data}" v-if="!isDisabled">
                        <vxe-form-item>
                            <template>
                                <a-button class="blue-btn" type="primary" @click="addClick(6)">新增</a-button>
                            </template>
                        </vxe-form-item>
                    </template>
                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                        <a-form layout="inline" class="search-form" >
                            <a-form-item v-if="!isDisabled">
                                <a-button class="blue-btn" type="primary" @click="editClick(row,6)" >编辑</a-button>
                            </a-form-item>
                            <a-form-item v-else>
                                <a-button class="blue-btn" type="primary" @click="editClick(row,6,'查看')" >查看</a-button>
                            </a-form-item>
                            <a-form-item v-if="!isDisabled">
                                <a-button class="red-btn" type="primary" @click="deleteClick(row,6)" >删除</a-button>
                            </a-form-item>
                        </a-form> 
                    </template>
                </commpVxeTable>
            </div>
            <!-- </a-collapse-panel>
            <a-collapse-panel key="14" header="变更控制" :style="customStyle"> -->
            <div v-if="activeKey  == '变更控制'" class="enterprise-information-content">
                <commpVxeTable
                    :key="refreshTable"
                    ref="headmanVxeTable"
                    :config="changeConfig" 
                    :columns="changeColumnsVxe" 
                    :formItem="changeFormItem"
                    :adaptiveHeight="true"
                    @updatedChange="updatedChange"
                    @searchEvent="changeSearchEvent"
                    @resetEvent="changeResetEvent"
                > 
                    <template v-slot:fbgrq_time>
                        <a-range-picker v-model:value="changeFbgrqTime"/>
                    </template>
                    <template v-slot:externalOperations="{data}" v-if="!isDisabled">
                        <vxe-form-item>
                            <template>
                                <a-button class="blue-btn" type="primary" @click="addClick(8)">新增</a-button>
                            </template>
                        </vxe-form-item>
                    </template>
                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                        <a-form layout="inline" class="search-form" >
                            <a-form-item v-if="!isDisabled">
                                <a-button class="blue-btn" type="primary" @click="editClick(row,8)" >编辑</a-button>
                            </a-form-item>
                            <a-form-item v-else>
                                <a-button class="blue-btn" type="primary" @click="editClick(row,8,'查看')" >查看</a-button>
                            </a-form-item>
                            <a-form-item v-if="!isDisabled">
                                <a-button class="red-btn" type="primary" @click="deleteClick(row,8)" >删除</a-button>
                            </a-form-item>
                        </a-form> 
                    </template>
                </commpVxeTable>
            </div>
            <!-- </a-collapse-panel>
            <a-collapse-panel key="3" header="偏差处理" :style="customStyle"> -->
            <div v-if="activeKey  == '偏差处理'" class="enterprise-information-content">
                <commpVxeTable
                    :key="refreshTable"
                    ref="headmanVxeTable"
                    :config="deviationConfig" 
                    :columns="productDeviationColumnsVxe" 
                    :formItem="deviationFormItem"
                    :adaptiveHeight="true"
                    @updatedChange="updatedChange"
                    @searchEvent="deviationSearchEvent"
                    @resetEvent="deviationResetEvent"
                > 
                    <template v-slot:ffxrq_time>
                        <a-range-picker v-model:value="ffxrqTime"/>
                    </template>
                    <template v-slot:externalOperations="{data}" v-if="!isDisabled">
                        <vxe-form-item>
                            <template>
                                <a-button class="blue-btn" type="primary" @click="addClick(1)">新增</a-button>
                            </template>
                        </vxe-form-item>
                    </template>
                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                        <a-form layout="inline" class="search-form" >
                            <a-form-item v-if="!isDisabled">
                                <a-button class="blue-btn" type="primary" @click="editClick(row,1)" >编辑</a-button>
                            </a-form-item>
                            <a-form-item v-else>
                                <a-button class="blue-btn" type="primary" @click="editClick(row,1,'查看')" >查看</a-button>
                            </a-form-item>
                            <a-form-item v-if="!isDisabled">
                                <a-button class="red-btn" type="primary" @click="deleteClick(row,1)" >删除</a-button>
                            </a-form-item>
                        </a-form> 
                    </template>
                </commpVxeTable>
            </div>
            <!-- </a-collapse-panel>
            <a-collapse-panel key="6" header="供应商审计" :style="customStyle"> -->
            <div v-if="activeKey  == '供应商审计'" class="enterprise-information-content">
                <commpVxeTable
                    :key="refreshTable"
                    ref="headmanVxeTable"
                    :config="{
                        api:assessCheckApi.spcyQyInfoQueryYlgyssjPageList,
                        rowId: 'id',
                        height:400,
                        autoHidden:true,
                        paramet:{
                            fqyid:formState.id
                        }
                    }" 
                    :columns="rawMaterialColumnsVxe" 
                    :formItem="[{
                        label: '物料分类',
                        model: 'fwlfl',
                    }]"
                    :adaptiveHeight="true"
                    @updatedChange="updatedChange"
                > 
                    <template v-slot:externalOperations="{data}" v-if="!isDisabled">
                        <vxe-form-item>
                            <template>
                                <a-button class="blue-btn" type="primary" @click="addClick(4)">新增</a-button>
                            </template>
                        </vxe-form-item>
                    </template>
                    <template v-slot:sfgq_name="{row}">
                        <span v-if="row.sfgq == '长期有效'" style="color: #91cc75;">长期有效</span>
                        <span v-if="row.sfgq == '未过期'" style="color: #5470c6;">未过期</span>
                        <span v-if="row.sfgq == '即将过期'" style="color: #fac858;">即将过期</span>
                        <span v-if="row.sfgq == '已过期'" style="color: #ee6666;">已过期</span>
                    </template>
                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                        <a-form layout="inline" class="search-form" >
                            <a-form-item v-if="!isDisabled">
                                <a-button class="blue-btn" type="primary" @click="editClick(row,4)" >编辑</a-button>
                            </a-form-item>
                            <a-form-item v-else>
                                <a-button class="blue-btn" type="primary" @click="editClick(row,4,'查看')" >查看</a-button>
                            </a-form-item>
                            <a-form-item v-if="!isDisabled">
                                <a-button class="red-btn" type="primary" @click="deleteClick(row,4)" >删除</a-button>
                            </a-form-item>
                        </a-form> 
                    </template>
                </commpVxeTable>
            </div>
            <!-- </a-collapse-panel>
            <a-collapse-panel key="13" header="投诉与不良反应信息报告" :style="customStyle" class="collapse-panel-head-l380"> -->
            <div v-if="activeKey  == '投诉与不良反应信息报告'" class="enterprise-information-content">
                <a-upload 
                :disabled="uploadLoading"
                style="display: inline-block;" 
                :beforeUpload="$event=>{return false}" 
                action="" 
                @change="WjljByTypeUpload($event,formState.id,'投诉与不良反应信息报告')">
                    <a-button :loading="uploadLoading" class="blue-btn" type="primary">上传</a-button>
                </a-upload>
                <commpVxeTable
                    :key="refreshTable"
                    ref="headmanVxeTable"
                    :config="{
                        api:assessCheckApi.queryWjljByType,
                        rowId: 'id',
                        height:400,
                        autoHidden:true,
                        paramet:{
                            fqyid:formState.id,
                            fwjlx1:'投诉与不良反应信息报告'
                        }
                    }" 
                    :columns="WjljByTypeColumnsVxe" 
                    :formItem="[]"
                    :adaptiveHeight="true"
                    @updatedChange="updatedChange"
                > 
                    <template v-slot:name_fwjxsmc="{row}" data-desc="自定操作栏">
                        <span>{{ row.fwjxsmc }}{{ row.fwjlx }}</span>
                    </template>
                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                        <a-form layout="inline" class="search-form" >
                            <a-form-item>
                                <a-button class="red-btn" type="primary" @click="deleteWjClick(row)" >删除</a-button>
                            </a-form-item>
                            <a-form-item>
                                <a-button class="blue-btn" type="primary" @click="downloadWjClick(row)" >下载</a-button>
                            </a-form-item>
                            <a-form-item>
                                <a-button class="blue-btn" type="primary" @click="lookOverWjClick(row)" v-if="row.fwjlx == '.pdf'">查看</a-button>
                            </a-form-item>
                            
                        </a-form> 
                    </template>
                </commpVxeTable>
            </div>
            <!-- </a-collapse-panel>
            <a-collapse-panel key="12" header="抽检不合格信息文件" :style="customStyle" class="collapse-panel-head-l380"> -->
            <div v-if="activeKey  == '抽检不合格信息文件'" class="enterprise-information-content">
                <a-upload 
                :disabled="uploadLoading"
                style="display: inline-block;" 
                :beforeUpload="$event=>{return false}" 
                action="" 
                @change="WjljByTypeUpload($event,formState.id,'抽检不合格信息文件')">
                    <a-button :loading="uploadLoading" class="blue-btn" type="primary">上传</a-button>
                </a-upload>
                <commpVxeTable
                    :key="refreshTable"
                    ref="headmanVxeTable"
                    :config="{
                        api:assessCheckApi.queryWjljByType,
                        rowId: 'id',
                        height:400,
                        autoHidden:true,
                        paramet:{
                            fqyid:formState.id,
                            fwjlx1:'抽检不合格信息文件'
                        }
                    }" 
                    :columns="WjljByTypeColumnsVxe" 
                    :formItem="[]"
                    :adaptiveHeight="true"
                    @updatedChange="updatedChange"
                > 
                    <template v-slot:name_fwjxsmc="{row}" data-desc="自定操作栏">
                        <span>{{ row.fwjxsmc }}{{ row.fwjlx }}</span>
                    </template>
                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                        <a-form layout="inline" class="search-form" >
                            <a-form-item>
                                <a-button class="red-btn" type="primary" @click="deleteWjClick(row)" >删除</a-button>
                            </a-form-item>
                            <a-form-item>
                                <a-button class="blue-btn" type="primary" @click="downloadWjClick(row)" >下载</a-button>
                            </a-form-item>
                            <a-form-item>
                                <a-button class="blue-btn" type="primary" @click="lookOverWjClick(row)" v-if="row.fwjlx == '.pdf'">查看</a-button>
                            </a-form-item>
                            
                        </a-form> 
                    </template>
                </commpVxeTable>
            </div>
            <!-- </a-collapse-panel>
            <a-collapse-panel key="10" header="违法违规" :style="customStyle"> -->
            <div v-if="activeKey  == '违法违规'" class="enterprise-information-content">
                <commpVxeTable
                    :key="refreshTable"
                    ref="headmanVxeTable"
                    :config="{
                        api:assessCheckApi.queryQyWfwjjlPageList,
                        rowId: 'id',
                        height:400,
                        autoHidden:true,
                        paramet:{
                            fqyid:formState.id
                        }
                    }" 
                    :columns="wfwjColumnsVxe" 
                    :formItem="[]"
                    :adaptiveHeight="true"
                    @updatedChange="updatedChange"
                > 
                </commpVxeTable>
            </div>
            <!-- </a-collapse-panel>
            <a-collapse-panel key="7" header="审评信息" :style="customStyle"> -->
            <div v-if="activeKey  == '审评信息'" class="enterprise-information-content">
                <commpVxeTable
                    :key="refreshTable"
                    ref="headmanVxeTable"
                    :config="{
                        api:assessCheckApi.spcyQyInfoQueryQyJcxxPageList,
                        rowId: 'id',
                        height:400,
                        autoHidden:true,
                        paramet:{
                            fqyid:formState.id
                        }
                    }" 
                    :columns="inspectColumnsVxe" 
                    :formItem="[]"
                    :adaptiveHeight="true"
                    @updatedChange="updatedChange"
                > 
                    <template v-slot:externalOperations="{data}" v-if="!isDisabled">
                        <vxe-form-item>
                            <template>
                                <a-button class="blue-btn" type="primary" @click="addClick(5)">新增</a-button>
                            </template>
                        </vxe-form-item>
                    </template>
                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                        <a-form layout="inline" class="search-form" >
                            <a-form-item v-if="!isDisabled">
                                <a-button class="blue-btn" type="primary" @click="editClick(row,5)" >编辑</a-button>
                            </a-form-item>
                            <a-form-item v-else>
                                <a-button class="blue-btn" type="primary" @click="editClick(row,5,'查看')" >查看</a-button>
                            </a-form-item>
                            <a-form-item v-if="!isDisabled">
                                <a-button class="red-btn" type="primary" @click="deleteClick(row,5)" >删除</a-button>
                            </a-form-item>
                        </a-form> 
                    </template>
                </commpVxeTable>
            </div>
            <!-- </a-collapse-panel>
            <a-collapse-panel key="15" header="检验记录" :style="customStyle" class="collapse-panel-head-l380"> -->
            <div v-if="activeKey  == '检验记录'" class="enterprise-information-content">
                <a-upload 
                :disabled="uploadLoading"
                style="display: inline-block;" 
                :beforeUpload="$event=>{return false}" 
                action="" 
                @change="WjljByTypeUpload($event,formState.id,'检验记录')">
                    <a-button :loading="uploadLoading" class="blue-btn" type="primary">上传</a-button>
                </a-upload>
                <commpVxeTable
                    :key="refreshTable"
                    ref="headmanVxeTable"
                    :config="{
                        api:assessCheckApi.queryWjljByType,
                        rowId: 'id',
                        height:400,
                        autoHidden:true,
                        paramet:{
                            fqyid:formState.id,
                            fwjlx1:'检验记录'
                        }
                    }" 
                    :columns="WjljByTypeColumnsVxe" 
                    :formItem="[]"
                    :adaptiveHeight="true"
                    @updatedChange="updatedChange"
                > 
                
                    <template v-slot:name_fwjxsmc="{row}" data-desc="自定操作栏">
                        <span>{{ row.fwjxsmc }}{{ row.fwjlx }}</span>
                    </template>
                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                        <a-form layout="inline" class="search-form" >
                            <a-form-item>
                                <a-button class="red-btn" type="primary" @click="deleteWjClick(row)" >删除</a-button>
                            </a-form-item>
                            <a-form-item>
                                <a-button class="blue-btn" type="primary" @click="downloadWjClick(row)" >下载</a-button>
                            </a-form-item>
                            <a-form-item>
                                <a-button class="blue-btn" type="primary" @click="lookOverWjClick(row)" v-if="row.fwjlx == '.pdf'">查看</a-button>
                            </a-form-item>
                            
                        </a-form> 
                    </template>
                </commpVxeTable>
            </div>
            <div v-if="activeKey  == '物料管理'" class="enterprise-information-content">
                <materialManage ref="materialManageRef" />
            </div>
            <div v-if="activeKey  == '生产车间'" class="enterprise-information-content">
                <workshopIndex ref="workshopIndexRef"/>
            </div>
            <div v-if="activeKey  == '信用评级'" class="enterprise-information-content">
                <a-upload 
                :disabled="uploadLoading"
                style="display: inline-block;" 
                :beforeUpload="$event=>{return false}" 
                action="" 
                @change="WjljByTypeUpload($event,formState.id,'信用评级')">
                    <a-button :loading="uploadLoading" class="blue-btn" type="primary">上传</a-button>
                </a-upload>
                <commpVxeTable
                    :key="refreshTable"
                    ref="headmanVxeTable"
                    :config="{
                        api:assessCheckApi.queryWjljByType,
                        rowId: 'id',
                        height:400,
                        autoHidden:true,
                        paramet:{
                            fqyid:formState.id,
                            fwjlx1:'信用评级'
                        }
                    }" 
                    :columns="WjljByTypeColumnsVxe" 
                    :formItem="[]"
                    :adaptiveHeight="true"
                    @updatedChange="updatedChange"
                > 
                
                    <template v-slot:name_fwjxsmc="{row}" data-desc="自定操作栏">
                        <span>{{ row.fwjxsmc }}{{ row.fwjlx }}</span>
                    </template>
                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                        <a-form layout="inline" class="search-form" >
                            <a-form-item>
                                <a-button class="red-btn" type="primary" @click="deleteWjClick(row)" >删除</a-button>
                            </a-form-item>
                            <a-form-item>
                                <a-button class="blue-btn" type="primary" @click="downloadWjClick(row)" >下载</a-button>
                            </a-form-item>
                            <a-form-item>
                                <a-button class="blue-btn" type="primary" @click="lookOverWjClick(row)" v-if="row.fwjlx == '.pdf'">查看</a-button>
                            </a-form-item>
                            
                        </a-form> 
                    </template>
                </commpVxeTable>
            </div>
            <div v-if="activeKey  == '附件资料'" class="enterprise-information-content">
                <div style="width: 100%;">
                    <table border="1" class="material-table" style="width: calc(100% - 20px);margin: 10px;">
                        <tr>
                            <th style="text-align: center;padding: 5px;">文件目录</th>
                            <th style="text-align: center;padding: 5px;">文件清单</th>
                        </tr>
                        <tr v-for="(item,index) in infoAllfjxxList" :key="index">
                            <td style="width: 30%;text-align: center;">{{ item.ml }}</td>
                            <td style="width: 70%;">
                                <div style="display: flex;width: 100%;flex-wrap: wrap;">
                                    <div class="file-td-box" v-for="(term,tIndex) in item.fjList">
                                        <a-icon class="eye-icon-v" type="eye" @click="lookOverWjClick(term)" v-if="term.fwjlx == '.pdf'"/>
                                        <a-icon class="download-icon-v" type="download" @click="downloadWjClick(term)"/>
                                        <a-icon class="file-icon-v" type="file-pdf" />
                                        <span>{{ term.fwjxsmc+term.fwjlx }}</span>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div v-if="activeKey  == '企业委托'" class="enterprise-information-content">
                <commpVxeTable
                    :key="refreshTable"
                    ref="headmanVxeTable"
                    :config="{
                        api:assessCheckApi.spcyQyInfoqueryQyWtxxPageList,
                        rowId: 'id',
                        height:400,
                        paramet:{
                            fqyid:formState.id
                        }
                    }" 
                    :columns="entrustColumnsVxe" 
                    :formItem="entrustFormItem"
                    @updatedChange="updatedChange"
                > 
                    <template v-slot:externalOperations="{data}" v-if="!isDisabled">
                        <vxe-form-item>
                            <template>
                                <a-button class="blue-btn" type="primary" @click="addClick(10)">新增</a-button>
                            </template>
                        </vxe-form-item>
                    </template>
                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                        <a-form layout="inline" class="search-form" >
                            <a-form-item v-if="!isDisabled">
                                <a-button class="blue-btn" type="primary" @click="editClick(row,10)" >编辑</a-button>
                            </a-form-item>
                            <a-form-item v-else>
                                <a-button class="blue-btn" type="primary" @click="editClick(row,10,'查看')" >查看</a-button>
                            </a-form-item>
                            <a-form-item v-if="!isDisabled">
                                <a-button class="red-btn" type="primary" @click="deleteClick(row,10)" >删除</a-button>
                            </a-form-item>
                        </a-form> 
                    </template>
                </commpVxeTable>
            </div>
            <div v-if="activeKey  == '设备信息'" class="enterprise-information-content">
                <commpVxeTable
                    :key="refreshTable"
                    ref="headmanVxeTable"
                    :config="{
                        api:assessCheckApi.spcyQyInfoqueryQySbxxPageList,
                        rowId: 'id',
                        height:400,
                        paramet:{
                            fqyid:formState.id
                        }
                    }" 
                    :columns="deviceInfoColumnsVxe" 
                    :formItem="deviceInfoFormItem"
                    @updatedChange="updatedChange"
                > 
                    <template v-slot:externalOperations="{data}" v-if="!isDisabled">
                        <vxe-form-item>
                            <template>
                                <a-button class="blue-btn" type="primary" @click="addClick(11)">新增</a-button>
                            </template>
                        </vxe-form-item>
                    </template>
                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                        <a-form layout="inline" class="search-form" >
                            <a-form-item v-if="!isDisabled">
                                <a-button class="blue-btn" type="primary" @click="editClick(row,11)" >编辑</a-button>
                            </a-form-item>
                            <a-form-item v-else>
                                <a-button class="blue-btn" type="primary" @click="editClick(row,11,'查看')" >查看</a-button>
                            </a-form-item>
                            <a-form-item v-if="!isDisabled">
                                <a-button class="red-btn" type="primary" @click="deleteClick(row,11)" >删除</a-button>
                            </a-form-item>
                        </a-form> 
                    </template>
                </commpVxeTable>
            </div>
            <!-- </a-collapse-panel>
        </a-collapse> -->
        </div>
        <addEdit0 ref="addEditRef0" @addItem="addItem" @editItem="editItem"/>
        <addEdit1 ref="addEditRef1" @addItem="addItem" @editItem="editItem"/>
        <addEdit2 ref="addEditRef2" @addItem="addItem" @editItem="editItem"/>
        <addEdit3 ref="addEditRef3" @addItem="addItem" @editItem="editItem"/>
        <addEdit4 ref="addEditRef4" @addItem="addItem" @editItem="editItem"/>
        <addEdit5 ref="addEditRef5" @addItem="addItem" @editItem="editItem"/>
        <addEdit6 ref="addEditRef6" @addItem="addItem" @editItem="editItem"/>
        <addEdit7 ref="addEditRef7" @addItem="addItem" @editItem="editItem"/>
        <addEdit8 ref="addEditRef8" @addItem="addItem" @editItem="editItem"/>
        <addEdit9 ref="addEditRef9" @addItem="addItem" @editItem="editItem"/>
        <addEdit10 ref="addEditRef10" @addItem="addItem" @editItem="editItem"/>
        <addEdit11 ref="addEditRef11" @addItem="addItem" @editItem="editItem"/>
        <addEdit001 ref="addEditRef001" @KeyPersonSX="KeyPersonSX" />

        <!-- 品种基本信息生产记录 -->
        <productionRecords ref="productionRecordsRef" />
        <keyIndicators ref="keyIndicatorsRef" />
    </div>
</template>
<script>
import assessCheckApi from './service/api'
import addEdit0 from './addEdit0.vue'
import addEdit1 from './addEdit1.vue'
import addEdit2 from './addEdit2.vue'
import addEdit3 from './addEdit3.vue'
import addEdit4 from './addEdit4.vue'
import addEdit5 from './addEdit5.vue'
import addEdit6 from './addEdit6.vue'
import addEdit7 from './addEdit7.vue'
import addEdit8 from './addEdit8.vue'
import addEdit9 from './addEdit9.vue'
import addEdit001 from './addEdit001.vue'
import addEdit10 from './addEdit10.vue'
import addEdit11 from './addEdit11.vue'
import productionRecords from './productionRecords/productionRecords.vue'
import keyIndicators from './keyIndicators/keyIndicators.vue'
import { 
    ocalityPostAction,
    spcyQyInfoQueryQyJbxxById,
    spcyQyInfoEditQyxx,

    spcyQyInfoDeleteQygjryx,
    spcyQyInfoUpdateQygjryxx,
    spcyQyInfoQygjryxx,

    spcyQyInfoDeleteCppcxx,
    spcyQyInfoUpdateCppcxx,
    spcyQyInfoAddCppcxx,

    spcyQyInfoDeletePzjbxx,
    spcyQyInfoUpdatePzjbxx,
    spcyQyInfoAddPzjbxx,

    spcyQyInfoDeleteSbqrxx,
    spcyQyInfoUpdateSbqrxx,
    spcyQyInfoAddSbqrxx,

    spcyQyInfoDeleteYlgyssj,
    spcyQyInfoUpdateYlgyssj,
    spcyQyInfoAddYlgyssj,

    spcyQyInfoDeleteJcxx,
    spcyQyInfoUpdateJcxx,
    spcyQyInfoAddQyJcxx,

    spcyQyInfoDeleteQjyz,
    spcyQyInfoUpdateQjyz,
    spcyQyInfoAddQjyz,

    spcyQyInfoDeleteGyyz,
    spcyQyInfoUpdateGyyz,
    spcyQyInfoAddGyyz,

    spcyQyInfoUploadMoreTypeFile,
    deleteFileById,
    getFileTypeServe,
    getCrossLocalFile,

    queryBgkzPageList,
    deleteBgkz,
    updateBgkz,
    addBgkz,

    spcyQyInfodeleteZjxx,
    spcyQyInfoupdateZjxx,
    spcyQyInfoaddZjxx,
    spcyQyInfoqueryQyInfoAllFj,

    spcyQyInfosaveQyWtxx,
    spcyQyInfodeleteQyWtxx,

    spcyQyInfosaveQySbxx,
    spcyQyInfodeleteQySbxx,

 } from './service/index'
 import moment from 'moment'
import commpVxeTable from '@/components/commp-vxe-table/commp-vxe-table.vue'
import blobType from '@/common/blobType'
import YchConstant from '@/api/YchConstant'
import materialManage from './materialManage/materialManage.vue'
import workshopIndex from './workshop/index.vue'
export default {
    components:{
        commpVxeTable,
        addEdit0,
        addEdit001,
        addEdit1,
        addEdit2,
        addEdit3,
        addEdit4,
        addEdit5,
        addEdit6,
        addEdit7,
        addEdit8,
        addEdit9,
        addEdit10,
        addEdit11,
        materialManage,
        workshopIndex,
        productionRecords,
        keyIndicators,
    },
    props:{
        enterpriseId:{
            type:String,
            default:'',
            required:false,
        }, 
        isDisabled:{
            type:Boolean,
            default:false,
            required:false,
        },
        height:{
            type:Number,
            default:0,
            required:false,
        }
    },
    data(){
        return{
            activeKey:'',
            activeList:[
                '企业信息',
                '品种基本信息',
                '企业关键人员信息',
                '证件信息',
                '质量管理体系文件',
                '设备确认信息',
                '工艺验证',
                '清洁验证',
                '变更控制',
                '偏差处理',
                '供应商审计',
                '投诉与不良反应信息报告',
                '抽检不合格信息文件',
                '违法违规',
                '审评信息',
                '检验记录',
                '物料管理',
                '生产车间',
                '信用评级',
                '附件资料',
                '企业委托',
                '设备信息',
            ],
            uploadLoading:false,
            assessCheckApi:assessCheckApi,
            customStyle:"background: #f7f7f7;border-radius: 4px;margin-bottom: 10px;border: 0;overflow: hidden",
            formState:{},
            optionsArr:[],
            ffxrqTime:[],
            changeFbgrqTime:[],
            form: this.$form.createForm(this, { name: 'coordinated' }),
            rules:{
                fqymc: [{
                    required: true,
                    message: '请输入企业名称',
                    trigger: 'blur',
                }],
                fqylx:[{
                    required: true,
                    message: '请选择企业类型',
                    trigger: 'blur',
                }],
                ftyshxydm: [{
                    required: true,
                    message: '请输入统一社会信用代码',
                    trigger: 'blur',
                }],
            },
            refreshTable:null,
            WjljByTypeColumnsVxe:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                title: '文件名称', //列头显示文字
                field: 'fwjxsmc',
                slots: {
                    // 使用插槽模板渲染
                    default: 'name_fwjxsmc',
                },
            },{
                title: '上传日期', //列头显示文字
                field: 'createTime',
            },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    },
                    width:250,
                    fixed:'right'
            }],
            changeFormItem:[{
                label: '变更日期范围',
                model: 'fbgrq',
                slotName:'fbgrq_time'

            },{
                label: '变更分类',
                model: 'fbgfl',
                placeholder: '变更分类',
                type:'Select',
                // 微小、中等、重大
                options:[{value:'微小',label:'微小'},{value:'中等',label:'中等'},{value:'重大',label:'重大'}]
            }],
            changeConfig:{
                api:assessCheckApi.queryBgkzPageList,
                rowId: 'id',
                height:400,
                autoHidden:true,
                paramet:{
                    // fqyid:formState.id
                }
            },
            changeColumnsVxe:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                title: '变更主题', //列头显示文字
                field: 'fbgzt',
            },{
                title: '变更分类', //列头显示文字
                field: 'fbgfl',
            },{
                title: '变更控制', //列头显示文字
                field: 'fbgkz',
            },{
                title: '变更编号', //列头显示文字
                field: 'fbgbh',
            },{
                title: '实施部门', //列头显示文字
                field: 'fssbm',
            },{
                title: '变更日期', //列头显示文字
                field: 'fbgrq',
            },{
                title: '变更记录', //列头显示文字
                field: 'fbgjl',
            },{
                title: '操作',
                field: 'id',
                slots: {
                    // 使用插槽模板渲染
                    default: 'operation_btn',
                },
                width:180,
                fixed:'right'
            }],

            deviationFormItem:[{
                label: '发现日期范围',
                model: 'ffxrq',
                slotName:'ffxrq_time'

            },{
                label: '偏差级别',
                model: 'fpcjb',
                placeholder: '偏差级别',
                type:'Select',
                options:[{value:'低级',label:'低级'},{value:'中级',label:'中级'},{value:'高级',label:'高级'}]
            }],
            KeyPersonActiveKey:'人员信息',
            enterpriseColumnsVxe:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                title: '关键人员', //列头显示文字
                field: 'fgjry',
            },{
                title: '人员类型', //列头显示文字
                field: 'frylx',
            },{
                title: '身份证号', //列头显示文字
                field: 'fsfzh',
                width:185,
            },{
                title: '工作经历', //列头显示文字
                field: 'fgzjl',
            },{
                title: '职称', //列头显示文字
                field: 'fzc',
            },{
                title: '学历', //列头显示文字
                field: 'fxl',
            },{
                title: '学位', //列头显示文字
                field: 'fxw',
            },{
                title: '专业', //列头显示文字
                field: 'fzy',
            },{
                title: '联系电话', //列头显示文字
                field: 'flxdh',
            },{
                title: '邮箱', //列头显示文字
                field: 'fyx',
            },{
                title: '座机号', //列头显示文字
                field: 'fzjh',
            },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    },
                    width:280,
                    fixed:'right'
            }],
            gwbgpriseColumnsVxe:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                title: '关键人员', //列头显示文字
                field: 'fgjry',
            },{
                title: '人员类型', //列头显示文字
                field: 'frylx',
            },{
                title: '身份证号', //列头显示文字
                field: 'fsfzh',
                width:185,
            },{
                title: '工作经历', //列头显示文字
                field: 'fgzjl',
            },{
                title: '职称', //列头显示文字
                field: 'fzc',
            },{
                title: '学历', //列头显示文字
                field: 'fxl',
            },{
                title: '学位', //列头显示文字
                field: 'fxw',
            },{
                title: '专业', //列头显示文字
                field: 'fzy',
            },{
                title: '联系电话', //列头显示文字
                field: 'flxdh',
            },{
                title: '邮箱', //列头显示文字
                field: 'fyx',
            },{
                title: '座机号', //列头显示文字
                field: 'fzjh',
            },{
                title: '变更后岗位', //列头显示文字
                field: 'fbghgw',
            },{
                title: '变更时间', //列头显示文字
                field: 'createTime',
            }],
            documentInformationFormItem:[{
                label: '证件名称',
                model: 'fzjmc',
            },{
                label: '证件编号',
                model: 'fzjbh',
            },{
                label: '证件分类',
                model: 'fzjfl',
            },{
                label: '是否过期',
                model: 'sfgq',
                placeholder: '是否过期',
                type:'Select',
                dictionaryType:'企业证件是否过期',
                
            }],
            //证件信息
            documentInformationColumnsVxe:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                title: '证件名称', //列头显示文字
                field: 'fzjmc',
            },{
                title: '证件编号', //列头显示文字
                field: 'fzjbh',
            },{
                title: '证件分类', //列头显示文字
                field: 'fzjfl',
            },{
                title: '发证日期', //列头显示文字
                field: 'ffzrq',
            },{
                title: '发证单位', //列头显示文字
                field: 'ffzdw',
            },{
                title: '证件有效期', //列头显示文字
                field: 'fzjyxq',
            },{
                title: '是否过期',
                field: 'sfgq',
                slots: {
                    // 使用插槽模板渲染
                    default: 'sfgq_name',
                },
            },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    },
                    width:180,
                    fixed:'right'
            }],
            deviationConfig:{
                api:assessCheckApi.spcyQyInfoQueryCppcxxPageList,
                rowId: 'id',
                height:400,
                autoHidden:true,
                paramet:{
                    // fqyid:formState.id
                }
            },
            productDeviationColumnsVxe:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                title: '偏差主题', //列头显示文字
                field: 'fpczt',
            },{
                title: '偏差编号', //列头显示文字
                field: 'fpcbh',
            },{
                title: '偏差级别', //列头显示文字
                field: 'fpcjb',
            },{
                title: '偏差部门', //列头显示文字
                field: 'fpcbm',
            },{
                title: '纠正预防措施', //列头显示文字
                field: 'fjzyfcs',
            },{
                title: '紧急措施/补救措施', //列头显示文字
                field: 'fjjcsbjcs',
            },{
                title: '偏差简述', //列头显示文字
                field: 'fpcjs',
            },{
                title: '根本原因', //列头显示文字
                field: 'fgbyy',
            },{
                title: '发现日期', //列头显示文字
                field: 'ffxrq',
            },{
                title: '关闭日期', //列头显示文字
                field: 'fgbrq',
            },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    },
                    width:180,
                    fixed:'right'
            }],
            breedColumnsVxe:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                title: '通用名称', //列头显示文字
                field: 'ftymc',
            },{
                title: '商品名', //列头显示文字
                field: 'fspm',
            },{
                title: '执行标准', //列头显示文字
                field: 'fzxbz',
            },{
                title: '药品有效期', //列头显示文字
                field: 'fypyxq',
            },{
                title: '药品分类', //列头显示文字
                field: 'fcplb',
            },{
                title: '处方', //列头显示文字
                field: 'fcf',
            },{
                title: '剂型', //列头显示文字
                field: 'fjx',
            },{
                title: '规格', //列头显示文字
                field: 'fgg',
            },{
                title: '批准文号', //列头显示文字
                field: 'fpzwh',
            },{
                title: '批准文号有限期', //列头显示文字
                field: 'fpzwhyxq',
            },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    },
                    width:210,
                    fixed:'right'
            }],
            deviceColumnsVxe:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                title: '序号', //列头显示文字
                field: 'forder',
            },{
                title: '设备名称', //列头显示文字
                field: 'fyzmc',
            },{
                title: '确认类型', //列头显示文字
                field: 'fwjlx1',
            },{
                title: '确认方案编号', //列头显示文字
                field: 'fyzfabh',
            },{
                title: '确认报告编号', //列头显示文字
                field: 'fyzbgbh',
            },{
                title: '备注', //列头显示文字
                field: 'fbz',
            },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    },
                    width:180,
                    fixed:'right'
            }],
            rawMaterialColumnsVxe:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },
            // {
            //     title: '物料目录', //列头显示文字
            //     field: 'fwlfl',
            // },{
            //     title: '经销商名称', //列头显示文字
            //     field: 'fjxsmc',
            // },
            {
                title: '质量标准', //列头显示文字
                field: 'fzlbz',
            },{
                title: '供应商类别', //列头显示文字
                field: 'fgyslb',
            },{
                title: '生产商名称', //列头显示文字
                field: 'fscsmc',
            },{
                title: '生产商地址', //列头显示文字
                field: 'fscsdz',
            },{
                title: '供应商地址', //列头显示文字
                field: 'fgysdz',
            },{
                title: '审计有效期', //列头显示文字
                field: 'fwlyxq',
            },{
                title: '是否过期', //列头显示文字
                field: 'sfgq',
                slots: {
                    default: 'sfgq_name',
                },
                
            },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    },
                    width:180,
                    fixed:'right'
            }],
            inspectColumnsVxe:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                title: '审评部门', //列头显示文字
                field: 'fjcry',
            },{
                title: '审评类型', //列头显示文字
                field: 'fjclx',
            },{
                title: '审评结论', //列头显示文字
                field: 'fjcjl',
            }
            // ,{
            //     title: '文件类型1', //列头显示文字
            //     field: 'fwjlx1',
            // },{
            //     title: '文件类型2', //列头显示文字
            //     field: 'fwjlx2',
            // }
            ,{
                title: '整改情况', //列头显示文字
                field: 'fzgqk',
            },{
                title: '审评时间', //列头显示文字
                field: 'fjcsj',
            },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    },
                    width:180,
                    fixed:'right'
            }],
            cleanColumnsVxe:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
                
            },{
                title: '序号', //列头显示文字
                field: 'forder',
            },{
                title: '验证名称', //列头显示文字
                field: 'fyzmc',
                slots: {
                    header:'fyzmc_header'
                }
            },{
                title: '验证方案编号', //列头显示文字
                field: 'fyzfabh',
            },{
                title: '验证报告编号', //列头显示文字
                field: 'fyzbgbh',
            },{
                title: '验证规格', //列头显示文字
                field: 'fyzgg',
            },{
                title: '验证批号', //列头显示文字
                field: 'fyzph',
            },{
                title: '验证批量', //列头显示文字
                field: 'fyzpl',
            },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    },
                    width:180,
                    fixed:'right'
            }],
            technologyColumnsVxe:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                title: '序号', //列头显示文字
                field: 'forder',
            },{
                title: '验证名称', //列头显示文字
                field: 'fyzmc',
                // sortable: true,//需要排序
            },{
                title: '验证方案编号', //列头显示文字
                field: 'fyzfabh',
            },{
                title: '验证报告编号', //列头显示文字
                field: 'fyzbgbh',
            },{
                title: '验证规格', //列头显示文字
                field: 'fyzgg',
            },{
                title: '验证批号', //列头显示文字
                field: 'fyzph',
            },{
                title: '验证批量', //列头显示文字
                field: 'fyzpl',
            },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    },
                    width:180,
                    fixed:'right'
            }],
            wfwjColumnsVxe:[{
                title: '违法内容', //列头显示文字
                field: 'fwfnr',
            },{
                title: '备注', //列头显示文字
                field: 'fbz',
            },{
                title: '填写日期',
                field: 'ftxrq',
            }],
            entrustFormItem:[{
                label: '受委托人姓名',
                model: 'fswtrxm',
            },{
                label: '委托人姓名',
                model: 'fwtrxm',
            },{
                label: '委托单位',
                model: 'fwtdw',
            }],
            entrustColumnsVxe:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                title: '受委托人姓名',
                field: 'fswtrxm',
            },{
                title: '委托人姓名',
                field: 'fwtrxm',
            },{
                title: '委托单位',
                field: 'fwtdw',
            },{
                title: '委托原因',
                field: 'fwtyy',
            },{
                title: '委托说明',
                field: 'fwtsm',
            },{
                title: '委托时间',
                field: 'fwtsj',
            },{
                title: '工作单位',
                field: 'fgzdw',
            },{
                title: '联系电话',
                field: 'flxdh',
            },{
                title: '所在地址',
                field: 'fszdz',
            },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    },
                    width:180,
                    fixed:'right'
            }],
            deviceInfoFormItem:[{
                label: '出厂编号',
                model: 'fccbh',
            },{
                label: '设备名称',
                model: 'fsbmc',
            },{
                label: '设备状态',
                model: 'fsbzt',
                placeholder: '设备状态',
                type:'Select',
                options:[{value:'正常',label:'正常'},{value:'损坏',label:'损坏'}]
            }],
            deviceInfoColumnsVxe:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                title: '出厂编号', //列头显示文字
                field: 'fccbh',
            },{
                title: '设备名称', //列头显示文字
                field: 'fsbmc',
            },{
                title: '设备精度', //列头显示文字
                field: 'fsbjd',
            },{
                title: '设备类型', //列头显示文字
                field: 'fsblx',
            },{
                title: '设备型号', //列头显示文字
                field: 'fsbxh',
            },{
                title: '设备数量', //列头显示文字
                field: 'fsbsl',
            },{
                title: '设备用途', //列头显示文字
                field: 'fsbyt',
            },{
                title: '原产地', //列头显示文字
                field: 'fycd',
            },{
                title: '单价', //列头显示文字
                field: 'fdj',
            },{
                title: '设备生产日期', //列头显示文字
                field: 'fsbscrq',
            },{
                title: '购置日期', //列头显示文字
                field: 'fgzrq',
            },{
                title: '使用年限', //列头显示文字
                field: 'fsynx',
            },{
                title: '检测范围', //列头显示文字
                field: 'fjcfw',
            },{
                title: '设备状态', //列头显示文字
                field: 'fsbzt',
            },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    },
                    width:180,
                    fixed:'right'
            }],
            methodList:[{
                name:'企业关键人员信息',
                editName:spcyQyInfoUpdateQygjryxx,
                deleteName:spcyQyInfoDeleteQygjryx,
                addName:spcyQyInfoQygjryxx,
            },{
                name:'偏差处理',
                deleteName:spcyQyInfoDeleteCppcxx,
                editName:spcyQyInfoUpdateCppcxx,
                addName:spcyQyInfoAddCppcxx,
            },{
                name:'品种信息',
                deleteName:spcyQyInfoDeletePzjbxx,
                editName:spcyQyInfoUpdatePzjbxx,
                addName:spcyQyInfoAddPzjbxx,
            },{
                name:'设备确认信息',
                deleteName:spcyQyInfoDeleteSbqrxx,
                editName:spcyQyInfoUpdateSbqrxx,
                addName:spcyQyInfoAddSbqrxx,
            },{
                name:'供应商审计',
                deleteName:spcyQyInfoDeleteYlgyssj,
                editName:spcyQyInfoUpdateYlgyssj,
                addName:spcyQyInfoAddYlgyssj,
            },{
                name:'审评信息',
                deleteName:spcyQyInfoDeleteJcxx,
                editName:spcyQyInfoUpdateJcxx,
                addName:spcyQyInfoAddQyJcxx,
            },{
                name:'清洁验证',
                deleteName:spcyQyInfoDeleteQjyz,
                editName:spcyQyInfoUpdateQjyz,
                addName:spcyQyInfoAddQjyz,
            },{
                name:'工艺验证',
                deleteName:spcyQyInfoDeleteGyyz,
                editName:spcyQyInfoUpdateGyyz,
                addName:spcyQyInfoAddGyyz,
            },{
                name:'变更控制',
                deleteName:deleteBgkz,
                editName:updateBgkz,
                addName:addBgkz,
            },{
                name:'证件信息',
                deleteName:spcyQyInfodeleteZjxx,
                editName:spcyQyInfoupdateZjxx,
                addName:spcyQyInfoaddZjxx,
            },{
                name:'企业委托',
                deleteName:spcyQyInfodeleteQyWtxx,
                editName:spcyQyInfosaveQyWtxx,
                addName:spcyQyInfosaveQyWtxx,
            },{
                name:'设备信息',
                deleteName:spcyQyInfodeleteQySbxx,
                editName:spcyQyInfosaveQySbxx,
                addName:spcyQyInfosaveQySbxx,
            }],
            currentAddRefName:'',
            infoAllfjxxList:[],
        }
    },
    watch:{
        enterpriseId: {
            immediate: true,
            handler(newValue,oldValue) {
                this.getData(newValue)
            }
        },
    },
    mounted(){
        ocalityPostAction({dictName:'观察员所属地市'}).then(res=>{
            if(res.code == 200){
                if(res.result.length){
                    this.optionsDataChange(res.result,{label:'itemText',value:'itemValue'})
                }
                
            }
        })
    },
    methods:{
        breadcrumbChange(val){
            this.activeKey = ''
        },
        activeChange(name){
            this.activeKey = name
            if(name == '物料管理'){
                this.$nextTick(()=>{
                    this.$refs.materialManageRef.getData({...this.formState,isDisabled:this.isDisabled})
                })
            }else if(name == '生产车间'){
                this.$nextTick(()=>{
                    this.$refs.workshopIndexRef.getData({...this.formState,isDisabled:this.isDisabled})
                })
                
            }else if(name == '附件资料'){
                this.getAllInfo(this.formState.id)
            }
            this.refreshTable = Date.now()
        },
        getAllInfo(val){
            spcyQyInfoqueryQyInfoAllFj({fqyid:val}).then(res=>{
                if(res.code == 200){
                    this.infoAllfjxxList = res.result
                }else{
                    this.infoAllfjxxList =  []
                }
            })
        },
        KeyPersonSX(){
            this.refreshTable = Date.now()
        },
        KeyPersonActiveChange(){
            this.refreshTable = Date.now()
        },
        //岗位变更
        JobChangeClick(val){
            this.$refs.addEditRef001.getData(val)
            this.$refs.addEditRef001.visible = true
        },
        enterpriseUpload(val){
            //console.log(val)
        },
        getData(val){
            let data = {}
            if(val){
                data = { fqyid:val }
            }
            spcyQyInfoQueryQyJbxxById(data).then(res=>{
                if(res.code == 200){
                    //console.log(res)
                    this.formState = {
                        ...res.result.qyxx,
                        fqyxkzyxq:res.result.qyxx.fqyxkzyxq?moment(res.result.qyxx.fqyxkzyxq,'YYYY-MM-DD'):'',
                        ffzrq:res.result.qyxx.ffzrq?moment(res.result.qyxx.ffzrq,'YYYY-MM-DD'):'',
                    }
                    this.deviationConfig['paramet'] = {
                        fqyid:this.formState.id
                    }
                    this.changeConfig['paramet'] = {
                        fqyid:this.formState.id
                    }
                    this.refreshTable = Date.now()
                }
            })
        },
        optionsDataChange(dataList,dataType){
            var newOptionArr = []
            //标识每一项的下标，并且添加到每一项
            dataList.forEach((item,index) => {
                 
                //console.log(newOptionArr.filter(l=>l.itemIndex === index))
                if(!newOptionArr.filter(l=>l.itemIndex === index).length){
                    newOptionArr.push({...item,itemIndex:index})
                }
            });
            //console.log('这是有下标的数组',newOptionArr)
            for (let i = 0; i <= newOptionArr.length; i++) {//打印的item为数组中的每一个对象
                let item = newOptionArr[i]
                let index = i
                for (let key in item) { //遍历数组中的对象
                    var currentItem = {}
                    //console.log(index)
                     
                    if(index === item.itemIndex){
                        currentItem = {
                            label:item[dataType.label],
                            value:item[dataType.value]
                        }
                        
                        if(!this.optionsArr.filter(l=>l.label === currentItem.label).length && currentItem.label){
                            this.optionsArr.push(currentItem)
                        }
                    }
                    

                }
            }
            //console.log('当前获取到的optionArr',this.optionsArr)
        },
        // 偏差表格事件
        deviationSearchEvent(){
            this.deviationConfig.paramet = {
                fqyid:this.formState.id,
                kssj:this.ffxrqTime.length?moment(this.ffxrqTime[0]).format('YYYY-MM-DD'):'',
                jssj:this.ffxrqTime.length?moment(this.ffxrqTime[1]).format('YYYY-MM-DD'):'',
            }
        },
        deviationResetEvent(){
            this.ffxrqTime = []
            this.deviationConfig.paramet = {
                fqyid:this.formState.id,
                kssj:'',
                jssj:'',
            }
        },
        //变更可控
        changeSearchEvent(){
            this.changeConfig.paramet = {
                fqyid:this.formState.id,
                kssj:this.changeFbgrqTime.length?moment(this.changeFbgrqTime[0]).format('YYYY-MM-DD'):'',
                jssj:this.changeFbgrqTime.length?moment(this.changeFbgrqTime[1]).format('YYYY-MM-DD'):'',
            }
        },
        changeResetEvent(){
            this.changeFfxrqTime = []
            this.changeConfig.paramet = {
                fqyid:this.formState.id,
                kssj:'',
                jssj:'',
            }
        },
        saveClick(){
            this.form.validateFields((err, values) => {
                if (!err) {
                    spcyQyInfoEditQyxx({
                        ...this.formState,
                        ...values,
                        fqyxkzyxq:this.formState.fqyxkzyxq?moment(this.formState.fqyxkzyxq).format('YYYY-MM-DD'):'',
                        ffzrq:this.formState.ffzrq?moment(this.formState.ffzrq).format('YYYY-MM-DD'):''
                    }).then(res=>{
                        if(res.code == 200){
                            this.$message.success(res.message)
                        }else{
                            this.$message.warning(res.message)
                        }
                        this.getData(this.formState.id)
                    })
                }
            })
        },
        WjljByTypeUpload({file},fqyid,fwjlx1){
            var that = this
            if(typeof file.uid !== 'undefined') {
                // if(file.name.indexOf(".xls") !== -1 || file.name.indexOf(".xlsx") !==-1) {
                    const fileData = new FormData();
                    fileData.append("file",file);
                    fileData.append("id",fqyid);
                    fileData.append("fwjlx1",fwjlx1);
                    this.uploadLoading = true
                    spcyQyInfoUploadMoreTypeFile(fileData).then(res => {
                        if(res.code){
                            if(res.code == 200){
                                this.uploadLoading = false
                                that.$message.success(res.message)
                            }else{
                                this.uploadLoading = false
                                that.$message.warning(res.message)
                            }
                            
                        }
                        if(res.byteLength){
                            if(res.code && res.code !== 200){
                                this.uploadLoading = false
                                that.$message.warning('请上传对应文件类型或者联系管理员!')
                            }else{
                                this.uploadLoading = false
                                that.$message.success('上传成功')
                            }
                        }
                        this.refreshTable = Date.now()
                    })
                // }
                
            }
        },
        deleteWjClick(val){
            var that = this
            this.$confirm({
                title:'您确认要删除吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    deleteFileById({id:val.id}).then(res=>{
                        if(res.code == 200){
                            that.$message.success('删除成功')
                            // that.getFile(that.formState)
                            that.refreshTable = Date.now()
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                },
                
            });
        },
        downloadWjClick(val){
            var that = this
            var fileName = val.fwjxsmc
            let param = {id:val.id}
            getFileTypeServe({id:val.id}).then(res=>{
                if(res.code == 200){
                    getCrossLocalFile(param).then((data) => {
                        if (!data) {
                            that.$message.warning('文件下载失败')
                            return
                        }else{
                        // if (typeof window.navigator.msSaveBlob !== 'undefined') {
                        //     window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }))
                        // } else {
                            let url = window.URL.createObjectURL(new Blob([data], { type: blobType.type[blobType.suffix.indexOf(val.fwjlx)] }))
                            let link = document.createElement('a')
                            link.style.display = 'none'
                            link.href = url
                            link.setAttribute('download', fileName + res.result)
                            document.body.appendChild(link)
                            link.click()
                            document.body.removeChild(link) //下载完成移除元素
                            window.URL.revokeObjectURL(url) //释放掉blob对象
                        // }
                        }
                    })
                }
                
            })
        },
        lookOverWjClick(val){
            window.open(
                bootConfig[process.env.NODE_ENV].locality_ApI+YchConstant.SPZX_SPCY+'/spcyQyInfo/getCrossLocalFile?id='+val.id
            )
        },
        updatedChange(val){
            //console.log(val)
        },
        //品种生产记录
        productionRecordsClick(val,index){
            this.$refs.productionRecordsRef.getData({fqyid:this.formState.id,...val,index:index})
            this.$refs.productionRecordsRef.visible = true
        },
        //关键指标
        keyIndicatorsClick(val,index){
            this.$refs.keyIndicatorsRef.getData({fqyid:this.formState.id,...val,index:index})
            this.$refs.keyIndicatorsRef.visible = true
        },
        addClick(index){
            this.currentAddRefName = 'addEditRef'+index
            let refName = 'addEditRef'+index
            this.$refs[refName].getData({fqyid:this.formState.id,index:index})
            this.$refs[refName].visible = true
        },
        editClick(val,index,view){
            //console.log(val)
            let refName = 'addEditRef'+index
            this.$refs[refName].getData({fqyid:this.formState.id,...val,index:index,view:view?true:false})
            this.$refs[refName].visible = true
        },
        addItem(val,vis,isTip){
            //console.log('新增',val)
            let refName = 'addEditRef'+val.index
            this.methodList[val.index].addName(val).then(res=>{
                if(res.code == 200){
                    this.refreshTable = Date.now()
                    if(!isTip){
                        this.$message.success(res.message)
                    }
                    
                    this.$refs[refName].getData({fqyid:this.formState.id,...res.result,index:val.index})
                    this.$refs[refName].visible = vis
                    //console.log(res)
                }else{
                    this.$message.warning(res.message)
                }
            })
        },
        editItem(val,vis){
            //console.log('编辑',val)
            let refName = 'addEditRef'+val.index
            this.methodList[val.index].editName(val).then(res=>{
                if(res.code == 200){
                    this.refreshTable = Date.now()
                    this.$message.success(res.message)
                    this.$refs[refName].visible = vis
                }else{
                    this.$message.warning(res.message)
                }
            })
        },
        deleteClick(val,index){
            var that = this
            this.$confirm({
                title:'您确认要删除吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    that.methodList[index].deleteName({ids:val.id}).then(res=>{
                        if(res.code == 200){
                            that.$message.success('删除成功')
                            that.refreshTable = Date.now()
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                },
                
            });
        },
    }
}
</script>
<style lang="less">
.enterprise-review-tabs{
    // width: 100%;
    padding: 0 5px;
    background-color: #fff;
    position: relative;
    // top: 48px;
    top: 0;
    right: 0;
    // margin:0 10px;
    font-size: 20px !important;
    font-weight: 600 !important;
    .ant-tabs-bar{
        margin: 0;
    }
    .ant-tabs-nav .ant-tabs-tab{
        padding-top: 5px;
        padding-bottom: 5px;
        margin-right: 10px;
    }
    .ant-tabs-nav-container{
        height: 50px !important;
    }
    .ant-tabs-nav-scroll{
        padding-top: 10px;
        padding-left: 10px;
    }
    .ant-tabs-tab-active{
        font-size: 16px;
        font-weight: 600 !important;
    }
    .ant-tabs-tab{
        font-size: 16px;
        font-weight: 600 !important;
        line-height: 40px !important;
        border-radius: 10px 10px 0 0 !important;
    }
    .ant-tabs-tab-active{
        background-color: #5ca3e5 !important;
        color: #fff !important;
        border-color: #5ca3e5 !important;
        box-shadow: 0px 0px 12px 0px #5ca3e5;
    }
    .ant-tabs-tab-prev.ant-tabs-tab-arrow-show,.ant-tabs-tab-next.ant-tabs-tab-arrow-show{
        border: 1px solid #5ca3e5;
        border-radius: 10px;
        height: 40px;
        margin-top: 10px;
    }
    .ant-tabs-tab-prev-icon-target,.ant-tabs-tab-next-icon-target{
        font-size: 16px;
        color: #5ca3e5;
    }
}
    
.enterprise-information-index{
    .enterprise-information-index-form{
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        // justify-content: space-between;
        .ant-form-item{
            display: flex;
        }
        .ant-form-item-label{
            width: 160px;
        }
        .ant-form-item-control-wrapper{
            width: 240px;
        }
        .ant-calendar-picker{
            width: 240px;
        }
        .flex-1-box{
            display: flex;
            width: 100%;
            .ant-form-item-control-wrapper{
                flex: 1;
            }
        }
    }
}
.red-btn{
    border: 1px solid #ed5565 !important;
    background-color: #ed5565 !important;
}
.ant-upload-list{
    display: none;
}
.ant-upload-list-item{
    display: none !important;
}
.enterprise-information-content{
    width: 100%;
    height: calc(100vh - 270px);
    overflow-y: auto;
    background: #fff;
    // box-shadow: 0px 0px 12px 0px #5ca3e5;
    margin: 10px 0;
    padding: 5px;
}
.palace-grid-breadcrumb{
    margin-top: 10px;
    height: calc(100vh - 203px);
    overflow-y: auto;
    background-color: #fff;
    // box-shadow: 0px 0px 12px 0px #5ca3e5;
    .breadcrumb-box1{
        padding: 20px 20px 0 20px;
        .ant-breadcrumb-link{
            // color: #5ca3e5;
            font-size: 16px;
            font-weight: 600;
        }
        .info-card-breadcrumb-text{
            .ant-breadcrumb-link a{
                color: #5ca3e5 !important;
            }
        }
    }
    
    .palace-grid-box{
        display: flex;
        flex-wrap: wrap;
        align-content: flex-start;
        padding: 15px 20px;
        height: calc(100vh - 248px);
        overflow-y: auto;
        .grid-box-for{
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100px;
            height: 100px;
            border-radius: 25px;
            padding: 10px;
            font-size: 16px;
            font-weight: 600;
            margin: 20px;
            background-color: #5ca3e5;
            box-shadow: 3px 4px 2px 1px #959a9b;
            color: #fff;
        }
    }
}

</style>
<style lang="less">
.file-td-box{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-content: space-between;
    text-align: center;
    width: 104px;
    height: 104px;
    overflow: hidden;
    border-radius: 2px;
    border: 1px solid #d9d9d9;
    padding: 8px;
    margin: 8px;
    position: relative;
    .delete-icon-v{
        font-size: 16px;
        position: absolute;
        color: rgb(24, 144, 255);
        right: 11px;
        top: 3px;
    }
    .eye-icon-v{
        font-size: 16px;
        position: absolute;
        color: rgb(24, 144, 255);
        right: 11px;
        top: 38px;
    }
    .download-icon-v{
        width: 20px;
        font-size: 16px;
        position: absolute;
        color: rgb(24, 144, 255);
        right: 9px;
        top: 20px;
    }
    .download-icon-apply{
        top: 10px;
    }
    .fjbz-text-v{
        color: #ff8000;
        font-size: 12px !important;
        display: inline-block;
        width: 28px;
        position: absolute;
        top: 5px;
        left: 3px;
    }
    .file-icon-v{
        font-size: 42px;
        color: rgb(24, 144, 255);
    }
    .file-icon-v{
        font-size: 42px;
        color: rgb(24, 144, 255);
    }
    span{
        height: 40px;
        display:block;
        text-overflow: -o-ellipsis-lastline;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        font-size: 14px;
    }
}
.enterprise-review-tabs{
    // width: 100%;
    padding: 0 5px;
    background-color: #fff;
    position: relative;
    // top: 48px;
    top: 0;
    right: 0;
    // margin:0 10px;
    font-size: 20px !important;
    font-weight: 600 !important;
    .ant-tabs-bar{
        margin: 0;
    }
    .ant-tabs-nav .ant-tabs-tab{
        padding-top: 5px;
        padding-bottom: 5px;
        margin-right: 10px;
    }
    .ant-tabs-nav-container{
        height: 50px !important;
    }
    .ant-tabs-nav-scroll{
        padding-top: 10px;
        padding-left: 10px;
    }
    .ant-tabs-tab-active{
        font-size: 16px;
        font-weight: 600 !important;
    }
    .ant-tabs-tab{
        font-size: 16px;
        font-weight: 600 !important;
        line-height: 40px !important;
        border-radius: 10px 10px 0 0 !important;
    }
    .ant-tabs-tab-active{
        background-color: #5ca3e5 !important;
        color: #fff !important;
        border-color: #5ca3e5 !important;
        box-shadow: 0px 0px 12px 0px #5ca3e5;
    }
    .ant-tabs-tab-prev.ant-tabs-tab-arrow-show,.ant-tabs-tab-next.ant-tabs-tab-arrow-show{
        border: 1px solid #5ca3e5;
        border-radius: 10px;
        height: 40px;
        margin-top: 10px;
    }
    .ant-tabs-tab-prev-icon-target,.ant-tabs-tab-next-icon-target{
        font-size: 16px;
        color: #5ca3e5;
    }
}
</style>